import pymysql
conn = pymysql.connect(host = "loachost",
                       user = "user",
                       password = "password",
                       db = "test",
                       charset = "utf8",
                       cursorclass = pymysql.cursors.DictCursor)